package com.example.demo6.Service;

import com.example.demo6.mapper.UserMapper;
import com.example.demo6.entity.LoginUser;
import com.example.demo6.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User getUser(LoginUser loginUser) {
        return userMapper.getUser(loginUser);
    }

    @Override
    public User getUserById(Integer userId) {
        return userMapper.getUserById(userId);
    }

//    @Override
//    public String getAvatarById(Integer userId){
//        String avatarPath = userMapper.getAvatarById(userId);
//        if (avatarPath == null) {
//            return null; // 如果头像路径为空，返回 null
//        }
//        return "/images/" + avatarPath; // 返回头像的 URL 路径
//    }
    }
